<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>卡槽</title>
  <script src="https://cdn.bootcss.com/vue/2.4.2/vue.min.js"></script>
</head>
<body>
<div id="vue_det">
  <child>
    <div slot="header">header</div>   <!--header，footer是自定义的名字。方便子组件引用-->
    <div slot="footer">footer</div>
  </child>

</div>
<script type="text/javascript">

  Vue.component('child',{
    template:`
        <div>
              <slot name="header"></slot>
              <h1>主题</h1>
              <slot name="footer"></slot>

        </div>
    `
  })

  var vm = new Vue({
    el: '#vue_det'
  })
</script>
</body>
</html>
